import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

extension StringExt on String {
  /// common text
  Text extText(
      {double? fontSize,
        Color? color,
        TextStyle? style,
        Key? key,
        TextAlign? textAlign,
        FontWeight? fontWeight,
        TextOverflow? overflow,
        int? maxLines}) {
    return Text(
      key: key,
      this,
      style: style ??
          TextStyle(
            color: color ?? Colors.black,
            fontSize: fontSize ?? 14.sp,
            fontWeight: fontWeight,
          ),
      textAlign: textAlign,
      maxLines: maxLines,
      overflow: overflow,
    );
  }
}

extension StringExtension on String? {
  bool isNullOrEmpty() {
    if (this == null) return true;
    if (this!.isEmpty) return true;
    return false;
  }
}